import request from '@/utils/request'

// 获取-权限点列表
export const getPermissionListAPI = () => {
  return request.get('/sys/permission')
}

// 删除-权限点
export const delPermissionListAPI = (id) => {
  return request.delete(`/sys/permission/${id}`)
}

// 新增-权限点
export function addPermissionListAPI(data) {
  return request({
    method: 'post',
    url: '/sys/permission',
    data
  })
}

// 获取权限详情
export function getPermissionDetailAPI(id) {
  return request({
    method: 'get',
    url: `/sys/permission/${id}`
  })
}

// 更新权限
export function updatePermissionAPI(data) {
  return request({
    method: 'put',
    url: `/sys/permission/${data.id}`,
    data
  })
}
